#ifndef _LOG_H
#define _LOG_H

#include <string.h>
#include <errno.h>

int log_verbosity;
int log_daemonized;

typedef enum {
	LOG_NORMAL = 1,
	LOG_ERROR = 2,
	LOG_VERBOSE = 3,
} LogLevel_t;

void print_log (LogLevel_t level, const char *format, ...)
	__attribute__ ((format (printf, 2, 3))); //OK

	inline void start_log( char * name );

	/* log_info
	 * Normal print, to replace printf
	 */
#define log_info(...)   { \
	print_log (LOG_NORMAL, __VA_ARGS__ ); \
}

	/* log_error
	 * Error messages, output to stderr
	 */
#define log_error(...)  { \
	print_log (LOG_ERROR, __VA_ARGS__ ); \
}

	/* log_verbose
	 * Output only in verbose mode
	 */
#define log_verbose(...) { \
	print_log (LOG_VERBOSE, __VA_ARGS__ ); \
}


#endif

